module LAN_RS232_Ctrl(
	clk_50m,
	rst_n,
	sw,
	led,
	
	
	TxD,
	RxD,
	config_en,
	config_scl,
	config_sda,	
	rden,
	addro,
	datao,
  
	n_RST,
	PWDN,
	INT,
	nCS,
	SCLK,
	MOSI,
	MISO
);


input			clk_50m;
input			rst_n;
input	[7:0] 	sw;
output	[1:0]	led;
output			TxD;
input			RxD;
inout			config_scl;
inout			config_sda;
output			config_en;
output				rden;
output	[15:0]		addro;
output	[7:0]		datao;
output				n_RST;
output				PWDN;
input				INT;
output				nCS;
output				SCLK;
output				MOSI;
input				MISO;
assign	led[0]	=	RxD;
//assign	led[1]	=	TxD;
assign	led[1]	=	INT;
assign	PWDN	=	0;

wire				clk;
wire				clk_100;
wire				clk_25;
pll 	pll50(
			.inclk0(clk_50m),
			.c0(clk_100),
			.c1(clk),
			.c2(clk_25)
	);


wire	[7:0]		config_d;
wire	[11:0]		config_a;
wire				config_e;
wire				config_o;

i2c_config zimu(
	.clk(clk),
	.rst_n(rst_n),
	.sw(sw),
		
	.TxD(TxD),
	.RxD(RxD),
		
	//.time_d(time_d),
	//.time_a(time_a),
	//.time_e(time_e),
	.time_o(n_RST),
	
	.config_d(config_d),
	.config_a(config_a),
	.config_e(config_e),
	.config_o(config_o),
	

	//.loopddc_scl(dvi_out_scl),
	//.loopddc_sda(dvi_out_sda),
	
	//.ds_scl(ds_scl),
	//.ds_sde(ds_sda_e),
	//.ds_sdi(ds_sda_i),
	//.ds_sdo(ds_sda_o),
	
	.eeprom_en(config_en),
	.scl(config_scl),
	.sda(config_sda)
);

W5200	 W5200(
	.clk(clk),
	.clk_100(clk_100),
	.rst_n(rst_n),
	.config_d(config_d),
	.config_a(config_a),
	.config_e(config_e),
	.config_o(config_o),
	.INT(INT),
	.rden(rden),
	.addro(addro),
	.datao(datao),
	.nCS(nCS),
	.SCLK(SCLK),
	.MOSI(MOSI),
	.MISO(MISO)
	);
endmodule 